package com.athuiju.hr.controller.front;


import com.athuiju.commonutils.R;
import com.athuiju.hr.entity.VisitIndustry;
import com.athuiju.hr.service.VisitIndustryService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wzh
 * @since 2022-01-02
 */
@RestController
@RequestMapping("/hr/visit-industry")
@Api(value="所属行业列表controller",tags={"小程序所属行业列表操作接口"})
public class VisitIndustryController {
    @Autowired
    public VisitIndustryService visitIndustryService;

    @ApiOperation(value = "查询全部行业信息controller")
    @GetMapping("visitIndustryAll")
    @ApiResponses({@ApiResponse(code = 200,message = "OK",response = VisitIndustry.class),
    })
    public R list(){
        List<VisitIndustry> list=visitIndustryService.list(null);
        return  R.ok().data("item",list);
    }

    @ApiOperation(value = "根据id查询行业信息controller")
    @GetMapping("getVisitIndustryInfo/{id}")
    @ApiResponses({@ApiResponse(code = 200,message = "OK",response = VisitIndustry.class),
    })
    public R getVisitIndustryInfo(@ApiParam(name = "id",value = "岗位id",required = true)
                              @PathVariable String id){
        VisitIndustry visitIndustry=visitIndustryService.getById(id);
        return  R.ok().data("visitIndustry",visitIndustry);
    }

}
